﻿using D.IdentityDbStore.Options;
using SqlSugar;

namespace D.IdentityDbStore.DbContext
{
    public class DbSql
    {
        public ISqlSugarClient Db;//用来处理事务多表查询和复杂的操作
        public DbSql(DbStoreOptions option)
        {
            var config = new ConnectionConfig()
            {
                ConnectionString = option.ConnectionString,
                DbType = option.DbType,
                InitKeyType = InitKeyType.Attribute,
                IsAutoCloseConnection = true
            };

            Db = new SqlSugarClient(config);
            //Db.DbMaintenance.CreateDatabase();
        }
    }
}
